<template>
   <div class="header" @click="showDetail">
     
     <div class="content-wrapper">
        <div class="avatar">
            <img width="74" height="74" :src="seller.avatar">
        </div>

        <div class="content">
            <div class="title">
               <span class="brand"></span>
               <span class="name">{{seller.name}}</span> 

            <div  v-if="seller.supports" class="support-count">
                <span class="count">{{seller.supports.length}}个</span>
                <i class="right">></i>
            </div>

            </div>
     
     <div class="description">
         {{seller.description}}/{{seller.deliveryTime}}分钟送达
     </div>

     <div v-if="seller.supports" class="support">
       <span class="icon"></span>
       <span class="text">{{seller.supports[0].description}}</span>  
     </div>

        </div>

     </div>



     <div class="bulletin-wrapper">
         <span class="bulletin-title"></span>
         <span class="bulletin-text">{{seller.bulletin}}
         <i class="bottom-right">></i>
         </span>
     </div>



 <div class="background">
     <img :src="seller.avatar" width="100%" height="100%">
 </div>


<div v-show="detailShow" class="detail">

    <div class="detail-wrapper clearfix">
   
        <div class="detail-main">
            <h1 class="name">{{seller.name}}</h1>
          <star :size="48" :score="seller.score"></star>
        </div>
    </div>

    <div class="detail-close">
        <i class="icon-close">×</i>
    </div>
 
</div>


   </div>

</template>
<script>
  import star from '../star/star'

    export default {
       props: {
        seller: {
            type: Object
        }
       },
       data() {
        return {
            detailShow: false
        }
       },
       methods: {
        showDetail() {
            this.detailShow = true
        }
       },
       components: {
          star
       }
    }
</script>
<style scoped>
    body, html {
        line-height: 1;
        font-weight: 200;
    }


    .header {
        position: relative;
        color: #fff;
        background: rgba(7,17,27,0.5);
        overflow: hidden;
    }

    .content-wrapper {
        position: relative;
        padding: 24px 12px 18px 24px;   
    }

    .avatar {
        display: inline-block;
        vertical-align: top;
    }

    .avatar img {
        border-radius: 5px;
    }

    .content {
        display: inline-block;
        margin-left: 16px;
        vertical-align: top;
    }

     .support-count {
        position: absolute;
        right: 12px;
        bottom: 18px;
        padding: 0 8px;
        height: 24px;
        line-height: 24px;
        border-radius: 14px;
        background: rgba(0, 0, 0, 0.2);
        text-align: center;
     }
      
      .count {
        font-size: 13px;
        vertical-align: top;
      }

       i.right{
        font-size: 12px;
        vertical-align: top;
      }
    
    .title {
        margin: 2px 0 8px 0;
    }
 
    .brand {
        display: inline-block;
        vertical-align: top;
        width: 30px;
        height: 18px;

       background-image: url(../header/brand@2x.png);
       background-size: 30px 18px;
       
       background-repeat: no-repeat;
    } 

   @media(-webkit-min-device-pixel-ratio:3),(min-device-pixel-ratio:3) {
        background-image: url(../header/brand@3x.png);
       }

    .name {
        margin-left: 6px;
        font-size: 16px;
        line-height: 18px;
        font-weight: bold;
    }

    .description {
        margin-bottom: 10px;
        line-height: 12px;
        font-size: 12px;
    }

     .support .icon{
            display: inline-block;
            vertical-align: bottom;
            width: 12px;
            height: 12px;
            margin-right: 4px;
            background-size: 12px 12px;
            background-repeat: no-repeat;

            background-image: url(../header/decrease_1@2x.png);
     }

     .text {
        
        line-height: 12px;
        font-size: 12px;
        vertical-align: bottom;
     }

     .bulletin-wrapper {
        position: relative;
          height: 28px;
          line-height: 28px;
          padding: 0 22px 0 12px;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
          background: rgba(7,17,27,0.2);
     }

     .bulletin-title {
        display: inline-block;
        vertical-align: middle;
        width: 22px;
        height: 12px;
        background-image: url(../header/bulletin@2x.png);
        background-size: 22px 12px;
        background-repeat: no-repeat;

     }

@media(-webkit-min-device-pixel-ratio:3),(min-device-pixel-ratio:3) {
 background-image: url(../header/bulletin@3x.png);
       }

    .bulletin-text {
        margin: 0 4px;
        vertical-align: middle;
        font-size: 13px;

    }
     
     .bottom-right {
      position:absolute;
      font-size: 14px;
      right: 12px;
      top: 1px;

     }

     .background {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: -1;
        filter: blur(5px);
     }

    
    .detail {
        position: fixed;
        z-index: 100;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background: rgba(7,17,27,0.8);
    }

    .detail-wrapper {
        min-height: 100%;
        width: 100%;
    }

    .detail-main {
        margin-top: 64px;
        padding-bottom: 64px;
    }

    .detail-close {
        position: relative;
        width: 32px;
        height: 32px;
        margin: -64px auto 0 auto;
        clear: both;
        font-size: 42px;
        text-align: center;
    }

    .detail-main h1.name {
        line-height: 16px;
        text-align: center;
        font-size: 18px;
        font-weight: 700;
    }



</style>